<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<script>
var num=parseInt(prompt("输入打印行数",""));
for(i=1;i<=num;i++){
 for(j=1;j<=i;j++){
     document.write("* ");
 }
 document.write("<br>");
}
</script>

<a href="http://wu-mu-hengze.gitee.io/web/2.html">正三角形</a>
</body>
</html>